package com.yml.mybatis.gererator.config;

import com.yml.mybatis.gererator.constant.OrmType;

/**
 * 全局配置
 *
 * @author YML
 * @since 2023-07-20 10:53
 */
public class GlobalConfig {

    /** 项目根目录 **/
    private String root = System.getProperty("user.dir");

    /** java代码存放位置 **/
    private String javaPath = "src/main/java";

    /** kotlin代码存放位置 **/
    private String kotlinPath = "src/main/kotlin";

    /** mapper文件存在位置 **/
    private String mapperPath = "src/main/java";

    /** xml文件存在位置 **/
    private String mapperXmlPath = "src/main/resources";

    /** 基础包名 **/
    private String basePackage = "com.example";

    /** orm类型 **/
    private OrmType ormType = OrmType.MYBATIS;

    /** 创建时间格式化 **/
    private String dateFormat = "yyyy-MM-dd HH:mm:ss";

    /** 文件创建人 **/
    private String author = "AutoGenerator";

    /** 模块名 **/
    private String modulePath = "";

    /** 忽略前缀 **/
    private String[] ignorePrefix = {};

    /** 是否开启lombok **/
    private boolean enableLombok = false;

    /** 是否开启swagger3 **/
    private boolean enableSwagger3 = false;

    /** 是否打印字段备注 **/
    private boolean enableColumnComment = false;

    /** 是否为kotlin格式 **/
    private boolean enableKotlin = false;

    public String getRoot() {
        return root;
    }

    public GlobalConfig setRoot(String root) {
        this.root = root;
        return this;
    }

    public String getJavaPath() {
        return javaPath;
    }

    public GlobalConfig setJavaPath(String javaPath) {
        this.javaPath = javaPath;
        return this;
    }

    public String getKotlinPath() {
        return kotlinPath;
    }

    public GlobalConfig setKotlinPath(String kotlinPath) {
        this.kotlinPath = kotlinPath;
        return this;
    }

    public String getMapperPath() {
        return mapperPath;
    }

    public GlobalConfig setMapperPath(String mapperPath) {
        this.mapperPath = mapperPath;
        return this;
    }

    public String getMapperXmlPath() {
        return mapperXmlPath;
    }

    public GlobalConfig setMapperXmlPath(String mapperXmlPath) {
        this.mapperXmlPath = mapperXmlPath;
        return this;
    }

    public String getBasePackage() {
        return basePackage;
    }

    public GlobalConfig setBasePackage(String basePackage) {
        this.basePackage = basePackage;
        return this;
    }

    public OrmType getOrmType() {
        return ormType;
    }

    public GlobalConfig setOrmType(OrmType ormType) {
        this.ormType = ormType;
        return this;
    }

    public String getDateFormat() {
        return dateFormat;
    }

    public GlobalConfig setDateFormat(String dateFormat) {
        this.dateFormat = dateFormat;
        return this;
    }

    public String getAuthor() {
        return author;
    }

    public GlobalConfig setAuthor(String author) {
        this.author = author;
        return this;
    }

    public String getModulePath() {
        return modulePath;
    }

    public GlobalConfig setModulePath(String modulePath) {
        this.modulePath = modulePath;
        return this;
    }

    public String[] getIgnorePrefix() {
        return ignorePrefix;
    }

    public GlobalConfig setIgnorePrefix(String... ignorePrefix) {
        this.ignorePrefix = ignorePrefix;
        return this;
    }

    public boolean isEnableLombok() {
        return enableLombok;
    }

    public GlobalConfig setEnableLombok(boolean enableLombok) {
        this.enableLombok = enableLombok;
        return this;
    }

    public boolean isEnableSwagger3() {
        return enableSwagger3;
    }

    public GlobalConfig setEnableSwagger3(boolean enableSwagger3) {
        this.enableSwagger3 = enableSwagger3;
        return this;
    }

    public boolean isEnableColumnComment() {
        return enableColumnComment;
    }

    public GlobalConfig setEnableColumnComment(boolean enableColumnComment) {
        this.enableColumnComment = enableColumnComment;
        return this;
    }

    public boolean isEnableKotlin() {
        return enableKotlin;
    }

    public GlobalConfig setEnableKotlin(boolean enableKotlin) {
        this.enableKotlin = enableKotlin;
        return this;
    }
}
